<!doctype html>
<html>
<head>
<title>
{eq name="brower" value="2"}
长按二维码，完成支付
{else/}
微信扫码({$out_trade_no})
{/eq}
</title>
<style>
*{margin:0;padding:0;}
body{background:url({$yf_theme_path}public/payment/images/bg.jpg) repeat;}
#main{background-color:#fff;padding:1px;width:500px;margin:100px auto;text-align:center;border-radius:3px;box-shadow:5px 5px 30px #333;}
#content{padding:30px;}
#title{color:#333;font-size:14px;background-color:#e8e8e8;border-bottom:1px solid #ccc;line-height:60px;}
#title span{color:#fb180a;font-size:16px;font-weight:bold;}
#QRmsg{color:#149696;background-color:#e8e8e8;border-top:1px solid #ccc;line-height:28px;padding:20px 0;font-size:16px;}
.qr_default{background:url({$yf_theme_path}public/payment/images/icon_pay.png) no-repeat 150px -63px;}
.qr_succ, .pay_succ{background:url({$yf_theme_path}public/payment/image/icon_pay.png) no-repeat 150px -3px;}
.pay_error{background:url({$yf_theme_path}public/payment/images/icon_pay.png) no-repeat 150px -120px;}
#msgContent p{text-align:left;padding-left:220px;}
#msgContent p a{color:#149696;font-weight:bold;}
</style>
<script src="{$yf_theme_pc_path}public/js/jquery.min.js"></script>
</head>

<body>
    <div id="main">
        <div id="title">订单号：<span id="orderid">{$out_trade_no}</span>&nbsp;&nbsp;&nbsp;&nbsp;金额：<span>{$money}.00</span> 元</div>
        <div id="content">
            <div id="QRimg">
                  <img src="{$pay_qrcode_url}" style="width:150px;height:150px;">
              </div>
        </div>
        <div id="QRmsg">
        <div id="msgContent" class="qr_default">
                  <p>支付码成功生成<br>请尽快完成支付</p>
        </div>
        
        {eq name="brower" value="2"}
         <div style="color:#fff;text-align:center"><h1>长按二维码，识别并完成付款。</h1></div>
        {/eq}
        
    </div>
    
    
    
    </div>
</body>
</html>
<script>
function pgo(){
  var ID = '{$out_trade_no}';
  $.ajax({
    url: '{:url("home/Payment/pay_check")}',
    type: 'POST',
    dataType: 'json',
    data: {out_trade_no: ID,sgin:'{$sgin}'},
    success: function (data){
      var _html = '';
      if(parseInt(data.code) == 1){
         $("#msgContent").removeClass('qr_default pay_error').addClass('pay_succ'); 
		 _html = '<p>'+data.msg+'</p><p><a href="'+data.url+'">点击查看</a></p>';
		 $("#msgContent").html(_html);
      }else if(parseInt(data.code) == -1){
		 $("#msgContent").removeClass('qr_default pay_succ').addClass('pay_error');  
		 _html = '<p>'+data.msg+'</p><p><a href="'+data.url+'">点击查看</a></p>'; 
		 $("#msgContent").html(_html);
	  }
    }
  });
};
$(function(){
  setInterval("pgo()", 2000);
});
</script>